/** 供需详情 */
import type { IFollowRecordFrom, IQuestionPageListResult } from "@/api/businessOpportunities/type"
import type { FormSchema } from "@/components/Form"
import type { ApplicationTypeEnum, BoTypeEnum, ReleaseTypeEnum } from "@/enums/businessOpportunitiesEnum"
import type { FunctionArgs } from "@vueuse/core"

export type SupplyDemandDetails = {
  id: number
  shareKey?: string
  successFn?: FunctionArgs
}

/** 精选答疑列表 */
export type AnsweringQuestionsList = {
  id: number
  /** 是否显示提交按钮 */
  showSubmit: boolean
}

/** 申请合作(直接合作/秘书处撮合) */
export type ApplyCooperation = {
  // 供需id
  id?: number
  /** 意向申请id */
  boUserApplyRecordId?: number
  type: ApplicationTypeEnum
  /** 是否是意向接收人(供需发布者)发起撮合 */
  isIntendedRecipient?: boolean
  shareKey?: string
}

/** 申请合作的结果页 */
export type ApplyCooperationResult = {
  // 申请id
  id: number
  type: ApplicationTypeEnum
  boInfoId: number
  /** 是否是意向接收人(供需发布者)发起撮合 */
  isIntendedRecipient?: boolean
  /** 撮合审核ID */
  auditRecordId?: number
}

/** 意向详情 */
export type IntentionDetails = {
  id: number
  /** 页面类型 send 我发出的 received 我收到的 */
  type: 'send' | 'received'
}

/** 合作意向(单个供需意向列表) */
export type IntentionCooperation = {
  id: number
  type: 'list' | 'statistics'
  boType: BoTypeEnum
  title: string
}

/** 合作意向统计结果详情 */
export type IntentionStatisticsDetail = {
  /**题目 */
  title: string;
  /**表单id */
  formId: number;
  id: number;
};

/** 申请撮合记录 */
export type ApplicationMatchingRecord = {
  id: number
}

/** 撮合详情 */
export type ApplicationMatchingRecordDetails = {
  id: number
  /** 是否是审核页 */
  isAudit?: boolean
}

/**供需详情编辑 */
export type EditBusinessOpportunitiesDetail = {
  editBusinessOpportunitiesDetail: string
  successFn?: FunctionArgs
  boType?: BoTypeEnum
}

/**供需发布 */
export type ReleaseBusinessOpportunities = {
  id?: number
  /** 发布类型 */
  releaseType: ReleaseTypeEnum
  shareKey?: string
  success?: () => void
}

/** 供需的表单创建 */
export type BusinessOpportunitiesFormCreate = {
  id?: number
  /** 发布类型 */
  // releaseType: ReleaseTypeEnum
  success: (formItemList: FormSchema[]) => void
}

/** 答疑详情 */
export type QuestionDetails = {
  /** 收到的 / 发出的 */
  type: 'received' | 'sent'
  data: IQuestionPageListResult
  autoFocus?: boolean
}

/** 根据供需查询答疑管理 */
export type SingleQuestionManage = {
  id: number
  boType: BoTypeEnum
  title: string
}

/**精选答疑管理 */
export type QuestionManage = {
  currentTab?: number
}
/**
 * 发布审核供需详情
 */
export type BusinessOpportunitieAuditDetail = {
  id: number
  successFn?: FunctionArgs
}


/**
 * 我的供需详情
 */
export type BusinessOpportunitieDetail = {
  id: number
  releaseType: ReleaseTypeEnum
  successFn: FunctionArgs
}

/**跟进记录 */
export type FollowUpRecords = {
  boInfoId: number
}
/**添加跟进记录 */
export type AddFollowUpRecords = {
  data: IFollowRecordFrom
  successFn: FunctionArgs
}

/** 撮合申请审核详情 */
export type CooperativeAuditDetail = {
  id: number
}

/**
 * 发布供需结果页
 */
export type ReleaseBoResult = {
  /**供需id */
  id: number
  /**审核id */
  reviewRecordId: number
}
/**推广详情 */
export type ExtensionDtail = {
  id: number
  boInfoId: number

}

/**推广记录浏览详情 */
export type DetailedBrowseRecord = {
  boInfoId: number
  /**用户id */
  queryAppUserInfoId: number
}

/**我的供需 */
export type MyBusinessOpportunities = {
  /**分享key */
  shareKey?: string
}

/**供需数据 */
export type BusinessOpportunitiesData = {
  /**供需id */
  boInfoId: number
  currentTab?: number | undefined
}
/**
 * 供需数据详细记录
 */
export type BusinessOpportunitiesDataBrowse = {
  boInfoId: number
  /**用户id */
  queryAppUserInfoId: number
}

/** 供需宣传页 */
export type BoPromotionalPage = {
  /** Invitation 邀请/分享 (外部)  Square 供需广场跳转时  */
  type: 'Invitation' | 'Square'
  shareKey?: string
}